package cn.lin.controller;

import cn.lin.domain.Organization;
import cn.lin.service.OrganizationService;
import cn.lin.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author qmp
 * @date 2024/12/6 22:01
 */
@RestController
@RequestMapping("/organization")
public class OrganizationController {

    @Autowired
    private OrganizationService organizationService ;

    @RequestMapping("/findAll")
    public Object findAll(){
        List<Organization> organizationList = organizationService.findAll();
        if (organizationList == null || organizationList.isEmpty()){
            return Result.error("查询失败") ;
        }
        return Result.ok("查询成功",organizationList) ;
    }

}
